< previous page page_738 next page >

Page 738
To move from your first document to your second, you need to run the NavigateTo method as shown in the following line of code:
Hyperlink.NavigateTo App.Path & "\docnav2.vbd"
The App.Path property specifies the path to the current document. By using this path as the basis for locating the second document, the document can be loaded without incident, provided that the documents are stored in the same directory. Figures 32.15 and 32.16 show the two pages of a sample document loaded in Internet Explorer. To get from the second document back to the first, you use the NavigateTo method again. For both documents, the method is used in code that responds to an event. The event is typically the Click event of a command button.
When you move to the second document of the application, notice that the Back button of Internet Explorer is enabled. You can use this button to move back to the first document. However, you should provide a direct link using the NavigateTo method because the first document may not always be the previous document in the history list. Also, if the first document has scrolled out of the history list, using the NavigateTo method is the only way to get to the document again.
Using and Displaying Forms from the Document
In addition to working with more than one document, you can work with standard forms in your ActiveX document applications. To use a form in a project, you create it the same way you would create a form for a standard projectdraw the interface of the form and write the code to perform tasks. To display the form from your document, use the Show method. Then, to remove the form, use the Unload statement.
sarrow.gifSee "Visual Basic Building Blocks," p. 39
Although forms can be part of your application, they are not handled the same way as documents. Forms are not contained within the application that contains the ActiveX document. Forms are independent of the container, as shown in Figure 32.17.
From Here . . .
This chapter introduced you to the world of ActiveX documents. You learned how these documents enable you to easily create applications that can run inside Internet Explorer or other ActiveX-enabled container applications. You also learned about the similarity between the UserDocument object and the forms of a standard application.
This chapter also touched on some other topics related to the creation of ActiveX documents that are covered in more detail in other chapters. To learn more about these topics, see the following chapters:

 
< previous page page_738 next page >